package com.tianji.aopdemo.service.impl;

import com.tianji.aopdemo.config.PrintTime;
import com.tianji.aopdemo.domain.User;
import com.tianji.aopdemo.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Yandel
 * @date 2025/8/18 下午7:32
 * @description:
 */
@Slf4j
@Service
public class UserServiceImpl implements IUserService {

    @Override
    @PrintTime(title="用户模块")
    public User getUserById(Long id) {
        log.info("getUserById开始执行...");
        User user = new User(id, "张三", 18);
        return user;
    }

    @Override
    public List<User> list() {
        User user1 = new User(1L, "张三", 18);
        User user2 = new User(2L, "张三111", 18);
        User user3 = new User(3L, "张三222", 18);
        User user4 = new User(4L, "张三333", 18);
        return List.of(user1, user2, user3, user4);
    }
}
